{% extends 'layouts/base.html' %}
{% load static i18n %}

{% block content %}
<div class="container">
    <div class="row">
        <div class="col-md-12">
            <h1 class="mt-4 mb-4">{% trans 'Dashboard de Logs' %}</h1>
            <ul class="list-group">
                {% for log in page_logs %}
                <li class="list-group-item">{{ log|linebreaks }}</li>
                {% empty %}
                <li class="list-group-item">{% trans 'Nenhum log encontrado.' %}</li>
                {% endfor %}
            </ul>

            {% if page_logs.has_other_pages %}
            <nav aria-label="{% trans 'Navegação de páginas' %} mt-4">
                <ul class="pagination">
                    {% if page_logs.has_previous %}
                    <li class="page-item">
                        <a class="page-link" href="?page=1">{% trans 'Primeira' %}</a>
                    </li>
                    <li class="page-item">
                        <a class="page-link" href="?page={{ page_logs.previous_page_number }}">{% trans 'Anterior' %}</a>
                    </li>
                    {% endif %}

                    <li class="page-item disabled">
                        <a class="page-link">{% trans 'Página' %} {{ page_logs.number }} {% trans 'de' %} {{ page_logs.paginator.num_pages }}</a>
                    </li>

                    {% if page_logs.has_next %}
                    <li class="page-item">
                        <a class="page-link" href="?page={{ page_logs.next_page_number }}">{% trans 'Próxima' %}</a>
                    </li>
                    <li class="page-item">
                        <a class="page-link" href="?page={{ page_logs.paginator.num_pages }}">{% trans 'Última' %}</a>
                    </li>
                    {% endif %}
                </ul>
            </nav>
            {% endif %}
        </div>
    </div>
</div>
{% endblock content %}
